package node;

public class MyNode<T> {
    /**
     * 节点值
     */
    private T value;
    /**
     * 下一个节点
     */
    private MyNode<T> next;

    public MyNode() {
    }

    public MyNode(T value, MyNode<T> next) {
        this.value = value;
        this.next = next;
    }

    public MyNode(T value) {
        this(value, null);
    }

    public T getValue() {
        return value;
    }

    public void setValue(T value) {
        this.value = value;
    }

    public MyNode<T> getNext() {
        return next;
    }

    public void setNext(MyNode<T> next) {
        this.next = next;
    }

    @Override
    public String toString() {
        return "Node{" +
                "value=" + value +
                '}';
    }
}